package com.zoe.app.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zbg
 * @date 2023/08/29
 * @description
 */
@Controller
@RequestMapping("/redirect")
public class RedirectController {
    // http://localhost:8081/redirect/zoe-01
    @GetMapping("zoe-01")
    public String zoe01() {
        return "01";
    }

    // http://localhost:8081/redirect/redirect-01
    @GetMapping("redirect-01")
    public String redirect01() {
        return "redirect:/redirect/zoe-01"; // 这边重定向的是接口的地址
    }


    // http://localhost:8081/redirect/forward-01
    @GetMapping("forward-01")
    public String forward01() {
        return "forward:/redirect/zoe-01"; // 这边转发向的是接口的地址
    }

    // http://localhost:8081/redirect/zoe-02
    @GetMapping("zoe-02")
    public String zoe02() {
        return "02";
    }
}
